package hlhj.fhp.checkpoint.atys

import android.support.v7.widget.LinearLayoutManager
import hlhj.fhp.checkpoint.BaseAty
import hlhj.fhp.checkpoint.R
import hlhj.fhp.checkpoint.adp.InfoAdp
import hlhj.fhp.checkpoint.iview.InfoView
import hlhj.fhp.checkpoint.javaBean.CheckInfoBean
import hlhj.fhp.checkpoint.presenter.InfoPresenter
import kotlinx.android.synthetic.main.lo_pub_head.*
import kotlinx.android.synthetic.main.lo_publist.*

/**
 * Created by Never Fear   on 2018\11\12 0012.
Never More....
 */
class CheckInfoAty :BaseAty<InfoView,InfoPresenter>(), InfoView {
    override fun setInfo(checkInfoBean: CheckInfoBean) {
        datas.addAll(checkInfoBean.info)
        infoAdp?.notifyDataSetChanged()
    }
    private var infoAdp:InfoAdp?=null
    private val datas=ArrayList<CheckInfoBean.InfoBean>()
    override fun initView() {
        tvTittle.text="信息查询"


        infoAdp= InfoAdp(datas)
        listView.adapter=infoAdp
        listView.layoutManager=LinearLayoutManager(this,LinearLayoutManager.VERTICAL,false)


    }

    override fun logicStart() {
        presenter?.getInfo(this)
    }

    override fun setListener() {
    }

    override fun bindView(): InfoView {
        return this
    }

    override fun createPresenter(): InfoPresenter {
        return InfoPresenter()
    }

    override val contentId: Int= R.layout.aty_info
}